
package com.caration.shell;

import com.caration.shell.config.CommonConfig;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class InstallShortcutReceiver extends BroadcastReceiver {
    public static final String ACTION_INSTALL_SHORTCUT = "com.android.launcher.action.INSTALL_SHORTCUT";

    public static BroadcastReceiver instance() {
        return new InstallShortcutReceiver();
    }

    public void onReceive(Context context, Intent intent) {
        if (ACTION_INSTALL_SHORTCUT.equals(intent.getAction())) {
            while (true) {
                try {
                    if (CommonConfig.isDesktopLock()) {
                        Thread.sleep(50);
                        continue;
                    }
                    Home.getInstance().a(intent);
                } catch (Exception localException) {
                }
            }
        }
    }
}
